﻿/// <summary>
/// 坐标点
/// </summary>
public class Coordinate
{
    public int X { get; private set; }
    public int Y { get; private set; }

    public Coordinate(int x, int y)
    {
        X = x;
        Y = y;
    }

    /// <summary>
    /// 与目标坐标点是否相等
    /// </summary>
    /// <param name="target">目标坐标</param>
    public bool Equal(Coordinate target)
    {
        if (target == null)
            return false;
        return X == target.X && Y == target.Y;
    }

    public override string ToString()
    {
        return $"({X}, {Y})";
    }
}


